package cn.gdcp.saxtest;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
   Button saxBtn;
   Button jsonBtn;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        saxBtn=findViewById(R.id.startActivity_for_sax);
        saxBtn.setOnClickListener(this);
        jsonBtn=findViewById(R.id.startActivity_for_json);
        jsonBtn.setOnClickListener(this);
    }

    public void onClick(View v) {
        switch (v.getId()){
            case R.id.startActivity_for_sax:
                startActivityForSax();
                break;
            case  R.id.startActivity_for_json:
                startActivityForJson();
                 break;

        }
    }

    private void startActivityForJson() {
        Intent intent=new Intent(MainActivity.this,JsonActivity.class);
              startActivity(intent);
    }

    private void startActivityForSax() {
        Intent intent=new Intent(MainActivity.this,SaxActivity.class);
                startActivity(intent);
    }
}
